package com.aaa.demo2;


import javax.swing.text.html.parser.Element;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * @Description:
 * @author:LiWei
 * @date:2022年10月26日9:39
 */
public class Test {
    public static void main(String[] args) {
        Dog dog = new Dog();
        dog.show(20);
        dog.show1("旺财");
    }
}

@Target({ElementType.TYPE,ElementType.METHOD,ElementType.FIELD,ElementType.PARAMETER,ElementType.LOCAL_VARIABLE, ElementType.ANNOTATION_TYPE})
@Retention(RetentionPolicy.SOURCE)
@interface Aa{
}

@Aa
class Dog{
    @Aa
    private String name;
    private int age;
    @Aa
    public  void show(@Aa int age){
        System.out.println(age);
    }
    @Aa
    public void show1(@Aa String name){
        System.out.println(name);
    }
}